/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */
#pragma once

#include "Camera.h"

namespace liba {
namespace lib3d {
namespace node {

class CameraParallel : public Camera
{
	NODE_DEFINITION(CameraParallel)
public:
	static const Atom node_name;

	CameraParallel( const Atom & name, Node * parent );
	CameraParallel(const CameraParallel& rhs);
	virtual CameraParallel * Clone() LIBA_OVERRIDE;

	// Attributes...
	static const Atom width_name;
	static const Atom height_name;

	virtual Ray get_world_ray(double ray_x, double ray_y);
	
	double GetWidth() { return width; }
	double GetHeight() { return height; }

	virtual bool ortho_projection()
	{
		return true;
	}
protected:
	virtual bool on_attribute( xml::Provider * prov, const std::string & name, const std::string & value );
	virtual void on_save_attributes( xml::SaverBase * saver )const;

	virtual void on_change_parameters();
private:
	void WidthChanged(double value);
	properties::DependencyProperty<double> width;
	void HeightChanged(double value);
	properties::DependencyProperty<double> height;
};

} // namespace node
} // namespace lib3d
} // namespace liba
using namespace liba;
